CFLAGS = -Wall -g
INCLUDES = -Iinclude

all: xsh

xsh: main.c shell.o history.o parser.o input.o builtins.o builtinmap.o redirect.o job.o
	gcc $(CFLAGS) $(INCLUDES) -o xsh $^

history.o: history.c include/history.h
	gcc $(CFLAGS) $(INCLUDES) -c history.c

shell.o: shell.c include/shell.h
	gcc $(CFLAGS) $(INCLUDES) -c shell.c

parser.o: parser.c include/parser.h
	gcc $(CFLAGS) $(INCLUDES) -c parser.c

input.o: input.c include/input.h
	gcc $(CFLAGS) $(INCLUDES) -c input.c

builtins.o: builtins.c include/builtins.h
	gcc $(CFLAGS) $(INCLUDES) -c builtins.c
	
builtinmap.o: builtinmap.c include/builtinmap.h
	gcc $(CFLAGS) $(INCLUDES) -c builtinmap.c

redirect.o: redirect.c include/redirect.h
	gcc $(CFLAGS) $(INCLUDES) -c redirect.c

job.o: job.c include/job.h
	gcc $(CFLAGS) $(INCLUDES) -c job.c

clean:
	rm xsh history.o shell.o parser.o input.o builtins.o builtinmap.o redirect.o job.o 

